#include <iostream>

using namespace std;

typedef long long LL;

int q;

int main()
{
	cin >> q;
	while(q--)
	{
		LL sum = 0;
		int a, b, c; cin >> a >> b >> c;
		int ret = min(min(a, b), c);
		sum += ret * 2;
		b  -= ret;	
		cout << sum + max(b, 1) - 1 << endl;	
	}
	return 0;
} 
